Skip to content

Glows time flags#2819

Merged
laspsandoval merged 20 commits intoIMAP-Science-Operations-Center:devfrom
laspsandoval:glows_flags
Mar 12, 2026
Merged

Glows time flags#2819
laspsandoval merged 20 commits intoIMAP-Science-Operations-Center:devfrom
laspsandoval:glows_flags

Conversation

@laspsandoval
Copy link
Contributor

This pull request introduces significant improvements to the GLOWS L1B data processing pipeline, focusing on more accurate computation and testing of histogram bad-time flags. The main changes include implementing a new compute_flags method for HistogramL1B, updating test data and test cases to align with the new flag logic, and adding utility functions for threshold extraction.

Enhancements to flag computation and logic:

  • Added the compute_flags method to the HistogramL1B class to compute the 17 bad-time flags based on onboard and ground processing logic, using thresholds from PipelineSettings. This replaces the previous approach of setting all flags to 1 and introduces more granular checks for temperature, voltage, spin period, and pulse length standard deviations.
  • Updated the __post_init__ method of HistogramL1B to use the new compute_flags method for initializing the flags attribute, ensuring flags are computed correctly at object creation.

Utility and helper functions:

  • Added a standalone get_threshold function to extract threshold values from nested dictionaries based on suffix matching, used in flag computation.

Testing improvements:

  • Updated the mock_pipeline_settings fixture to provide realistic flag values, reflecting the new flag computation logic.
  • Enhanced the test_process_histogram and added a new test_compute_flags test to validate the new flag computation, including cases where threshold values are exceeded and flags are set to bad. [1] [2]
  • Added a unit test for the get_threshold function to ensure correct extraction of threshold values from the settings dictionary.

These changes collectively improve the accuracy, maintainability, and test coverage of the GLOWS L1B data processing pipeline.

@laspsandoval laspsandoval added this to the March 2026 milestone Mar 6, 2026
@laspsandoval laspsandoval self-assigned this Mar 6, 2026
@laspsandoval laspsandoval added Ins: GLOWS Related to the GLOWS instrument Level: L1 Level 1 processing labels Mar 6, 2026
@laspsandoval laspsandoval added this to IMAP Mar 6, 2026
@laspsandoval laspsandoval requested a review from maxinelasp March 6, 2026 21:45
@laspsandoval
Copy link
Contributor Author

There are two flags that we not well-defined in the Algorithm Document that I will need to come back to:

flag based on comparison of the total numbers of counts in a given block-accumulated histogram with the
daily average (deviations by n-sigma and more are interpreted as beyond daily statistical error), see the end of Sec. 10.2

external information on exceeding a background threshold (TBC)

@laspsandoval laspsandoval marked this pull request as draft March 9, 2026 15:54
@tech3371 tech3371 linked an issue Mar 9, 2026 that may be closed by this pull request
3 tasks
@tech3371 tech3371 removed this from the March 2026 milestone Mar 9, 2026
@laspsandoval laspsandoval marked this pull request as ready for review March 9, 2026 21:11
Copy link
Contributor

@maxinelasp maxinelasp left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good! I had one suggestion for moving a function

@laspsandoval laspsandoval merged commit c951167 into IMAP-Science-Operations-Center:dev Mar 12, 2026
14 checks passed
@laspsandoval laspsandoval deleted the glows_flags branch March 12, 2026 19:47
@github-project-automation github-project-automation bot moved this to Done in IMAP Mar 12, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Ins: GLOWS Related to the GLOWS instrument Level: L1 Level 1 processing

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

ENH - Histogram Bad-time Flag Array for GLOWS L1B

3 participants